#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
const int N = 1e6 + 10;
int a[N], b[N], c[N];
int sa, sb, sc;
bool cmd(string& s1, string& s2)
{
    if (s1.size() != s2.size())
    {
        return s1.size() < s2.size();
    }
    return s1 < s2;
}
void sub(int a[], int b[], int c[])
{
    for (int i = 0; i < sc; i++)
    {
        c[i] += a[i] - b[i];
        if (c[i] < 0)
        {
            c[i + 1] -= 1;
            c[i] += 10;
        }
    }
    if (sc > 1 && c[sc - 1] == 0)
        sc--;
}
int main()
{
    string s1, s2;
    cin >> s1 >> s2;
    if (cmd(s1, s2))
    {
        swap(s1, s2);
        cout << '-';
    }
    sa = s1.size();
    sb = s2.size();
    sc = max(sa, sb);
    for (int i = 0; i < sa; i++)
        a[sa - 1 - i] = s1[i] - '0';
    for (int i = 0; i < sb; i++)
        b[sb - 1 - i] = s2[i] - '0';
    sub(a, b, c);
    for (int i = sc - 1; i >= 0; i--)
    {
        cout << c[i];
    }
    return 0;
}